<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"/>
    <link rel="stylesheet" href="../css/Token_Start.css"/>
    <link rel="stylesheet" href="../common/common.css"/>
    <script src="../js/jquery-3.2.1.min.js"></script>
	<script src="../js/Token_Start.js"></script>
	<script type="text/javascript">
		//这里是判断是否登入 如果没有登入全部跳到登入页面
		$.ajax({
			url:'/app/user_registered/islogin',
		    dataType:"json",   //返回格式为json
		    async:true,//请求是否异步，默认为异步，这也是ajax重要特性
		    data:{},    //参数值
		    type:"GET",   //请求方式
		    success:function(r){
		    	console.log(r)
		        if(r.code == 0){
		        	//登入状态
		        	
		        	var html="欢迎您，"+r.customer.username+"<br/> 用户余额 ："+r.customer.candycount;
		        	$(".Token_MY_header").html(html);
		        }else{
		        	var html="<a href='Token_login.html'><span>登陆</span></a> / <a href='Token_login.html'><span>注册</span></a>"
		        		$(".Token_MY_header").html(html);
		        	//没有登入
		        	$(".Token_MY_foot").css("display","none");
		        }
		    }
		});
		
	</script>
</head>
<body>
<header class="Token_MY">
    <p>我的</p>
</header>
<div class="Token_MY_logo">
<span class="pull-left"><img src="http://otornsb9e.bkt.clouddn.com/000247589.jpg"></span>
<div class="Token_MY_header pull-right"></div>
</div>

<div class="Token_MY_Text">
    <ul>
        <a href="Token_Wallet/Token_Wallet_Manager.html"><li><span>钱包管理</span>         <span><img src="../img/my01.png" alt=""/></span></li></a>
        <a href="Token_My/Token_My_Record.html"><li><span>交易记录</span>         <span><img src="../img/my02.png" alt=""/></span></li></a>
        <a><li><span>发送/接收记录</span>    <span><img src="../img/my03.png" alt=""/></span></li></a>
        <a href="https://etherscan.io/" target="blank"><li><span>发送区块查询</span>     <span><img src="../img/my04.png" alt=""/></span></li></a>
        <a href=""><li><span>系统消息</span>         <span><img src="../img/my05.png" alt=""/></span></li></a>
        <a href=""><li><span>关于我们</span>         <span><img src="../img/my06.png" alt=""/></span></li></a>
    </ul>
</div>
<div class="Token_MY_foot"> <span id="loginout">退 出 登 陆</span> </div>


<footer>
    <div class="foot-bottom-div">
        <ul class="foot-bottom">
            <li><a href="Token_Assets.html"><i class="icon-asset"></i><p>资产</p></a></li>
            <li><a href="../Token_Start.html"><i class="icon-market "></i><p>行情</p></a></li>
            <li><a href="Token_Trading/Token_Trading.html"><i class="icon-trade"></i><p>交易</p></a></li>
            <li class="curr"><a href="Token_My.html"><i class="icon-person"></i><p>我的</p></a></li>
        </ul>
    </div>
</footer>

</body>
<script type="text/javascript">
	$("#loginout").click(function(){
		//这里是判断是否登入 如果没有登入全部跳到登入页面
		/* href="https://etherscan.io/" target="blank" */
		$.ajax({
			url:'/app/user_registered/loginout',
		    dataType:"json",   //返回格式为json
		    async:true,//请求是否异步，默认为异步，这也是ajax重要特性
		    data:{},    //参数值
		    type:"POST",   //请求方式
		    success:function(r){
		    	if(r.code == 0){
		    		sessionStorage.removeItem("token");
		    		localStorage.removeItem("token");
		    		location.reload();
		    	}else{
		    		alert(r.msg);
		    	}
		    }
		});
	})
</script>
</html>